<li <?php echo (!isset($_GET['c']) || !isset($_GET['p'])) ? 'class="active"' : ''; ?>>
	<a href="index.php">Home</a>
</li>
<?php
global $db;
$stmt = $db->prepare("SELECT Naam, Pagina FROM recht INNER JOIN pagina
	ON recht.PaginaID=pagina.PaginaID WHERE recht.GroepID = :GroepID");
$stmt->bindParam(':GroepID', $_SESSION['GroepID'], PDO::PARAM_INT);
$stmt->execute();
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
if (!empty($result))
{
	foreach ($result as $row)
	{
		echo '<li ';
		if (isset($_GET['c']) && isset($_GET['p']))
			if ('?c=' . $_GET['c'] . '&p=' . $_GET['p'] == $row['Pagina'])
				echo 'class="active"';
			$naamOverzicht=($row['Naam']=="Overzichten"&&$_SESSION['GroepID']==1)?"Mijn Bestellingen":$row['Naam'];
		echo '><a href="' . $row['Pagina'] . '">' . $naamOverzicht . '</a></li>';
	}
}
?>
